package com.ywl.exercise.dao.impl;

import java.sql.SQLException;

import org.springframework.stereotype.Repository;

import com.ywl.exercise.dao.BaseDao;
import com.ywl.exercise.dao.GameDao;
import com.ywl.exercise.entity.GameEntity;


@Repository
public class GameDaoImpl extends BaseDao<GameEntity> implements GameDao {

	@Override
	public int saveGame(GameEntity entity) {
		String hql = "{call insertGame(?,?,?)}";
		int gameid = 0;
		try {
			gameid = super.get(hql, entity);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return gameid;
	}

	@Override
	public void updateGame(GameEntity entity) {
		super.update(entity);
	}

	@Override
	public GameEntity findById(Integer gameid) {
		return super.get(gameid);
	}

	
}
